package com.cn.common;

import com.cn.remote.ResponseFuture;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class RemotingResponseWrapper {

    private static final ConcurrentMap<Integer, ResponseFuture> responseTable = new ConcurrentHashMap<>(256);

    public static void add(int opaque, ResponseFuture responseFuture) {
        responseTable.put(opaque, responseFuture);
    }

    public static void remove(int opaque) {
        responseTable.remove(opaque);
    }

    public static ResponseFuture get(int opaque) {
        return responseTable.get(opaque);
    }

}
